# !/usr/bin python3
# encoding: utf-8 -*-
# @file     : order_page.py
# @author   : 沙陌 Matongxue_2
# @Time     : 2023/7/16 11:26
# @Copyright: 北京码同学
import time

from pages.base_page import SellerBasePage


class SellerOrderListPage(SellerBasePage):

    def send_keys_search_text(self, text):
        ele_info = self.page_eles['搜索输入框']
        self.operate.send_keys(ele_info, text)
        return self
    def click_search_btn(self):
        ele_info = self.page_eles['搜索按钮']

        self.operate.click(ele_info)
        return self
    def click_view_detail(self):
        ele_info = self.page_eles['查看详情']
        self.operate.click(ele_info)
        return SellerOrderDetailPage()

class SellerOrderDetailPage(SellerBasePage):
    def send_keys_express_num(self, express_num):
        # time.sleep(2)
        ele_info = self.page_eles['发货单号']
        self.operate.send_keys(ele_info, express_num)
        value = self.operate.get_attribute(ele_info,"value")
        while value!=express_num:
            self.operate.send_keys(ele_info, express_num)
            value = self.operate.get_attribute(ele_info, "value")
            time.sleep(1.5)
        return self
    def click_fahuo_btn(self):

        ele_info = self.page_eles['发货按钮']
        self.operate.click(ele_info)
        return self
    def click_confirm_btn(self):
        ele_info = self.page_eles['确定按钮']
        self.operate.click(ele_info)
        return self
    def click_confirm_pay(self):
        ele_info = self.page_eles['确认收款']
        self.operate.click(ele_info)
        return self